#![recursion_limit = "1500"]
extern crate proc_macro;

mod macro_enum;

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
}

#[proc_macro_derive(ImplEnumIter)]
pub fn impl_enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    let ast = syn::parse(input).unwrap();
    let stream = macro_enum::impl_macro(&ast);
    // let code = stream.to_string().replace('\n', "");
    // println!("............gen macro ImplEnumIter code: {}", code);
    stream
}
